// Geometric Tools, Inc.
// http://www.geometrictools.com
// Copyright (c) 1998-2006.  All Rights Reserved
//
// The Wild Magic Library (WM3) source code is supplied under the terms of
// the license agreement
//     http://www.geometrictools.com/License/WildMagic3License.pdf
// and may not be copied or disclosed except in accordance with the terms
// of that agreement.

#ifndef WM3POLYGONOFFSETSTATE_H
#define WM3POLYGONOFFSETSTATE_H

#include "Wm3FoundationLIB.h"
#include "Wm3GlobalState.h"

namespace Wm3
{

class WM3_ITEM PolygonOffsetState : public GlobalState
{
    WM3_DECLARE_RTTI;
    WM3_DECLARE_NAME_ID;
    WM3_DECLARE_STREAM;
    WM3_DECLARE_INITIALIZE;
    WM3_DECLARE_TERMINATE;

public:
    virtual int GetGlobalStateType () const { return POLYGONOFFSET; }

    PolygonOffsetState ();
    virtual ~PolygonOffsetState ();

    // Set whether offset should be enabled for the various polygon drawing
    // modes (fill, line, point).
    bool FillEnabled;   // default: false
    bool LineEnabled;   // default: false
    bool PointEnabled;  // default: false

    // The offset is Scale()*dZ + Bias()*r where dZ is the change in depth
    // relative to the screen space area of the poly, and r is the smallest
    // resolvable depth difference.  Negative values move polygons closer to
    // the eye.
    float Scale;  // default: 0
    float Bias;   // default: 0
};

WM3_REGISTER_STREAM(PolygonOffsetState);
WM3_REGISTER_INITIALIZE(PolygonOffsetState);
WM3_REGISTER_TERMINATE(PolygonOffsetState);
typedef Pointer<PolygonOffsetState> PolygonOffsetStatePtr;

}

#endif
